﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Analysis.Business;
using System.Data;
using System.IO;
using Microsoft.Win32;

namespace Analysis
{
  static class Program
  {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
      try
      {
        Registry.ClassesRoot.CreateSubKey("Microsoft.Workflow").CreateSubKey("CLSID");
      }
      catch (Exception)
      {
      }
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      DevExpress.Skins.SkinManager.EnableFormSkins();
      Config.GetConfig.Path = Application.StartupPath;
      Config.GetConfig.Load();
      if (File.Exists(Application.StartupPath + "\\Ayarlar.ini"))
      {
        using (dbMikro tbl = new dbMikro())
        {
          tbl.CreateTable();
        }

        Licensing lic = new Licensing();
        if (lic.CheckEvaluate())
        {
            Application.Run(new frmMain());
            eMail.KullaniyorMailiGonder();
        }
        else
            MessageBox.Show("Kullanım Süreniz Bitmiştir.\r\nLütfen tr.freelancer@gmail.com mail adresinden\r\nbizimle irtibata geçin.");
      }
      else
        Application.Run(new frmAyarlar(true));
    }
  }
}
